package web.stu.model.vo;

import cn.hutool.core.bean.BeanUtil;
import lombok.Data;
import web.stu.model.entity.Score;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class ScoreVO implements Serializable {
    private static final long serialVersionUID = 1L;

    private Integer id;

    /**
     * 学生id
     */
    private Integer studentId;

    /**
     * 课程id
     */
    private Integer courseId;

    /**
     * 班级id
     */
    private Integer classId;

    /**
     * 教师id
     */
    private Integer teacherId;

    /**
     * 学生姓名
     */
    private String studentName;
    /**
     * 课程名称
     */
    private String courseName;
    /**
     * 班级名称
     */
    private String className;
    /**
     * 教师名称
     */
    private String teacherName;
    /**
     * 分数
     */
    private BigDecimal score;

    /**
     * 审核状态(0:拒绝,1:通过,2:复核中)
     */
    private Integer status;

    public static ScoreVO objToVO(Score score) {
        // 非空判断
        if (score == null) {
            return null;
        }
        return BeanUtil.copyProperties(score, ScoreVO.class);
    }


    public static Score voToObj(ScoreVO scoreVO) {
        // 非空判断
        if (scoreVO == null) {
            return null;
        }
        return BeanUtil.copyProperties(scoreVO, Score.class);
    }
}
